package com.voicechat.firstmet.realm;

import android.os.Parcel;
import android.os.Parcelable;

import io.realm.RealmObject;
import io.realm.annotations.PrimaryKey;

/**
 * @ProjectName: FirstMet
 * @Package: com.voicechat.firstmet.realm
 * @ClassName: ListBean
 * @Description: java类作用描述
 * @Author: ljp
 * @CreateDate: 2018/11/19 17:00
 * @Version: 1.0
 */
public class ListBean extends RealmObject implements  Parcelable{
    /**
     * id : 111
     * isNewRecord : false
     * name : 游轮
     * gold : 101
     * imgUrl : head/64121538037382.jpg
     * animationUrl : head/64121538037382.jpg
     * version : 1
     */
    @PrimaryKey
    private String id;//礼物id
    private boolean isNewRecord;
    private String name;//礼物名称
    private int gold;//该礼物需要的金币数
    private String imgUrl;//礼物的图片地址
    private String animationUrl;//有动画礼物的动画地址
    private int version;
    private int	 type;				//类型 0 搭讪 1 礼物

    public ListBean() {
    }

    protected ListBean(Parcel in) {
        id = in.readString();
        isNewRecord = in.readByte() != 0;
        name = in.readString();
        gold = in.readInt();
        imgUrl = in.readString();
        animationUrl = in.readString();
        version = in.readInt();
    }

    public static final Parcelable.Creator<ListBean> CREATOR = new Parcelable.Creator<ListBean>() {
        @Override
        public ListBean createFromParcel(Parcel in) {
            return new ListBean(in);
        }

        @Override
        public ListBean[] newArray(int size) {
            return new ListBean[size];
        }
    };

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public boolean isIsNewRecord() {
        return isNewRecord;
    }

    public void setIsNewRecord(boolean isNewRecord) {
        this.isNewRecord = isNewRecord;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getGold() {
        return gold;
    }

    public void setGold(int gold) {
        this.gold = gold;
    }

    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    public String getAnimationUrl() {
        return animationUrl;
    }

    public void setAnimationUrl(String animationUrl) {
        this.animationUrl = animationUrl;
    }

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(id);
        dest.writeByte((byte) (isNewRecord ? 1 : 0));
        dest.writeString(name);
        dest.writeInt(gold);
        dest.writeString(imgUrl);
        dest.writeString(animationUrl);
        dest.writeInt(version);
    }

    @Override
    public String toString() {
        return "ListBean{" +
                "id='" + id + '\'' +
                ", isNewRecord=" + isNewRecord +
                ", name='" + name + '\'' +
                ", gold=" + gold +
                ", imgUrl='" + imgUrl + '\'' +
                ", animationUrl='" + animationUrl + '\'' +
                ", version=" + version +
                '}';
    }
}
